<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class LoginLogs extends \App\Utils\CreateMigration
{

    function columns(Blueprint $table)
    {
        $table->string('ip', 50)->default('')->comment('ip地址');
        $table->unsignedBigInteger('user_id')->default(0)->comment('用户ID');
        $table->unsignedTinyInteger('client')->default(1)->comment('登录的客户端 @CT');
        $table->string('desc')->nullable()->comment('备注');
        $table->index(['deleted_at', 'user_id'], 'index_deleted_user_id');
    }

    function tableInfo()
    {
        return ['login_logs', '登录日志'];
    }
}
